package com.zjy.springbootinit.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @program: springboot-init
 * @ClassName HelloController
 * @description:
 * @author: Ats
 * @create: 2025-04-14 11:08
 * @Version 1.0
 */
@RestController
public class HelloController {

    @Autowired
    Environment env;

    @RequestMapping("/hello")
    public String hello(){
        System.out.println("赵本山,我的第一个SpringBoot项目！");
        return "我是赵本山-东北老铁，这是我的第一个SpringBoot项目！当前端口是："+ env.getProperty("server.port");
    }
}
